//Node中 http模块是node的原生模块 可以搭建简单的web服务器
const http = require('http')
// express 源码依赖的 merge-descriptors  第三方模块  用法见记录
const mixin = require('merge-descriptors')

module.exports = function createServer(){
  const app = function(req,res){
    res.end('Response From Server')
  }
  mixin(app, proto, false)
  return app
}

const proto = Object.create(null)
proto.listen = function(port){
  const server = http.createServer(this)
  console.log("this",this)
  return server.listen.apply(server,arguments)
}